﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MasterPage.Master" AutoEventWireup="true" CodeBehind="BGMKPIResultList.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGMKPIResultList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<script src="../../Scripts/jquery-1.9.0.min.js" type="text/javascript"></script>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

        function ItemClicked(item, target) {

            var ra = item.value;
            radopen("BGMKPIResultList_POP.aspx?Target=" + target + "&Item=" + item , "POP");
            return false;
        }

        function closeRadWindow(oWnd, args) {
            var arg = args.get_argument();
            var combo = $find("<%= cboRadTarget.ClientID %>");
            var selectVal = document.getElementById("<%= cboRadTarget.ClientID %>").value;
            if (selectVal !== arg) {
                var selected = combo.findItemByValue(arg);
                selected.select();
            }

            $find('<%= RadManager1.ClientID %>').ajaxRequest();
        }

    </script>
 </telerik:RadCodeBlock>

 <telerik:RadWindowManager 
        ID="RadWindowManager1" 
        ShowContentDuringLoad="false" 
        VisibleStatusbar="false" 
        ReloadOnShow="true" 
        runat="server" 
        Skin="Web20" 
        Modal="true" 
        KeepInScreenBounds="true" 
        Style="z-index: 7000">
        <Windows>
            <telerik:RadWindow 
                ID="POP" 
                runat="server" 
                Width="1000px" Height='<%# Unit.Pixel(new SsMng().HeightI - 100) %>'
                Behaviors="Reload, Close" OnClientClose="closeRadWindow">
            </telerik:RadWindow>
        </Windows>
</telerik:RadWindowManager>

    <link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css" />

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >
    </telerik:RadAjaxLoadingPanel>

    <telerik:RadAjaxManager runat="server" ID="RadManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" onAjaxReQuest="RadManager1_AjaxReQuest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rblKPIType">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rblKPIType" />
                    <telerik:AjaxUpdatedControl ControlID="pnlListItem" />       
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cboRadYear">
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="pnlListItem" />         
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadManager1">
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="grdRadMonth" />   
                    <telerik:AjaxUpdatedControl ControlID="grdRadQuarter" />
                    <telerik:AjaxUpdatedControl ControlID="grdRadAnnual" />                
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <div style="width: 1000px">
    <div class="Background710" style="margin:10px 0px 10px 0px;">
    <div class="BackgroundBottom710">
        <asp:RadioButtonList ID="rblKPIType" RepeatDirection="Horizontal" 
            CellPadding="0" CellSpacing="0" runat="server" Width="700" 
            AutoPostBack="True" DataTextField="type_name" DataValueField="kpi_list_type_seq"
            onselectedindexchanged="rblKPIType_SelectedIndexChanged" >
        </asp:RadioButtonList>



    </div>
    </div>
    <br />

    <asp:Panel ID="pnlListItem" runat="server" GroupingText="เลือกผลผลิต">
       <table>
            <tr>
                <td width="200px" align="right">
                    ปี :
                </td>
                <td>
                    <telerik:RadComboBox ID="cboRadYear" runat="server" Width="200px"
                        OnSelectedIndexChanged="cboRadYear_SelectedIndexChanged" 
                        AutoPostBack="True">
                    </telerik:RadComboBox>
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td width="200px" align="right">
                    <asp:Label ID="Label1" runat="server"></asp:Label>
                </td>
                <td>
                    <telerik:RadComboBox ID="cboRadJobSite" runat="server" Width="400px" Visible="False"
                        OnSelectedIndexChanged="cboRadJobSite_SelectedIndexChanged" 
                        DataTextField="text" DataValueField="value" 
                        AutoPostBack="true" Filter="Contains">
                    </telerik:RadComboBox>
                    <telerik:RadComboBox ID="cboRadSubAct" runat="server" Width="400px" Visible="false"
                        DataTextField="bgm_strat_list_name" DataValueField="bgm_strat_data_map_seq"
                        AutoPostBack="True"  Filter="Contains" 
                        onselectedindexchanged="cboRadSubAct_SelectedIndexChanged">
                    </telerik:RadComboBox>
                    <telerik:RadComboBox ID="cboRadMainAct" runat="server" Width="400px" Visible="false"
                        DataTextField="bgm_strat_list_name" DataValueField="bgm_strat_data_map_seq"
                        AutoPostBack="True" Filter="Contains" 
                        onselectedindexchanged="cboRadMainAct_SelectedIndexChanged">
                    </telerik:RadComboBox>
                    <telerik:RadComboBox ID="cboRadOutput" runat="server" Width="400px" Visible="false"
                        DataTextField="bgm_strat_list_name" DataValueField="bgm_strat_data_map_seq"
                        AutoPostBack="True" Filter="Contains" 
                        onselectedindexchanged="cboRadOutput_SelectedIndexChanged">
                    </telerik:RadComboBox>
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td width="200px" align="right">
                    <asp:Label ID="lblProj" runat="server" Visible="false" Text="โครงการ :"></asp:Label>
                </td>
                <td>
                    <telerik:RadComboBox ID="cboRadBgmProjSeq" runat="server" Width="400px" Visible="false"
                        DataTextField="bgm_proj_name" DataValueField="bgm_proj_seq"
                        AutoPostBack="True"  Filter="Contains" 
                        onselectedindexchanged="cboRadBgmProjSeq_SelectedIndexChanged">
                    </telerik:RadComboBox>
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td width="200px" align="right">
                    <asp:Label ID="lblTarget" runat="server" Visible="false" Text="ประเภทเป้าหมาย :"></asp:Label>
                </td>
                <td>
                    <telerik:RadComboBox ID="cboRadTarget" runat="server"  Visible="false" Width="200px"
                    DataTextField="target_name" DataValueField="target_seq" 
                    AutoPostBack="True"   >
                    </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">
                </td>
                <td>
                    <br />
                    <telerik:RadButton ID="btnRadSubmit" runat="server" 
                        onclick="btnRadSubmit_Click" Visible="false">
                    </telerik:RadButton>
                </td>
            </tr>
        </table>
        
        <br />
        <br />

        <telerik:RadGrid ID="grdRadMonth" runat="server" CellSpacing="0"
            AutoGenerateColumns="false" Visible="false" GridLines="None" Width="985px" Height="500px">
            <MasterTableView Width="100%" ShowHeadersWhenNoRecords="true">
                <NoRecordsTemplate>
                    <div> There are no records to display </div>
                </NoRecordsTemplate>
                <ColumnGroups>
                    <telerik:GridColumnGroup HeaderText="ตุลาคม" Name="month10" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="พฤศจิกายน" Name="month11" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="ธันวาคม" Name="month12" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="มกราคม" Name="month1" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="กุมภาพันธ์" Name="month2" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="มีนาคม" Name="month3" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="เมษายน" Name="month4" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="พฤษภาคม" Name="month5" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="มิถุนายม" Name="month6" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="กรกฎาคม" Name="month7" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="สิงหาคม" Name="month8" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderText="กันยายน" Name="month9" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="160px">
                    </telerik:GridColumnGroup>
                </ColumnGroups>
                <Columns>
                    <telerik:GridTemplateColumn AllowFiltering="false" visible="true" >
                        <HeaderStyle HorizontalAlign="Center" Width="30px" />
                        <ItemTemplate>
                            <asp:ImageButton ID="Edit" runat="server" BorderWidth="0px" 
                                ImageUrl="../Image/Grid/Edit.gif" 
                                OnClientClick='<%# String.Format("ItemClicked({0},{1})",Eval("kpi_seq"),Eval("target_seq")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" HeaderStyle-Width="250px" 
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="kpi_name"
                        HeaderText="ชื่อตัวชี้วัด">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" HeaderStyle-Width="100px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="bgm_kpi_type_name"
                        HeaderText="ประเภทตัวชี้วัด">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" HeaderStyle-Width="100px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="kpi_unit"
                        HeaderText="หน่วยวัด">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="bgm_kpi_det_result_TOTAL" 
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px" 
                        HeaderText="รวมทั้งสิ้น" ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month10" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Oct_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month10" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Oct_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month11" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Nov_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month11"  HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Nov_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month12" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Dec_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month12" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Dec_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month1" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Jan_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month1" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Jan_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month2" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Feb_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month2" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Feb_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month3" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Mar_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month3" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Mar_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month4" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Apr_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month4" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Apr_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month5" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="May_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month5" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="May_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month6" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Jun_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month6" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Jun_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month7" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Jul_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month7" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Jul_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month8" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Aug_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month8" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Aug_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month9" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Sep_Target"
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="month9" HeaderStyle-Width="80px"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" DataField="Sep_Result"
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <clientsettings>
                <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
            </clientsettings>
        </telerik:RadGrid>

        <telerik:RadGrid ID="grdRadQuarter" runat="server" CellSpacing="0" 
            AutoGenerateColumns="False" Visible="False" GridLines="None" Width="985px" Height="500px">
            <ClientSettings>
                <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" 
                    ScrollHeight=""  />
            </ClientSettings>
            <MasterTableView Width="100%" ShowHeadersWhenNoRecords="true">
                <NoRecordsTemplate>
                    <div> There are no records to display </div>
                </NoRecordsTemplate>
                <ColumnGroups>
                    <telerik:GridColumnGroup HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderText="ไตรมาส 1" Name="quarter1">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderText="ไตรมาส 2" Name="quarter2">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderText="ไตรมาส 3" Name="quarter3">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridColumnGroup>
                    <telerik:GridColumnGroup HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderText="ไตรมาส 4" Name="quarter4">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridColumnGroup>
                </ColumnGroups>
                <CommandItemSettings ExportToPdfText="Export to PDF" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                    Visible="True">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                    Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn AllowFiltering="false" visible="true">
                        <HeaderStyle HorizontalAlign="Center" Width="30px" />
                        <ItemTemplate>
                            <asp:ImageButton ID="Edit" runat="server" BorderWidth="0px" 
                                ImageUrl="../Image/Grid/Edit.gif" 
                                OnClientClick='<%# String.Format("ItemClicked({0},{1})",Eval("kpi_seq"),Eval("target_seq")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="kpi_name" 
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" 
                        HeaderStyle-Width="250px" HeaderText="ชื่อตัวชี้วัด">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                        DataField="bgm_kpi_type_name" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px" 
                        HeaderText="ประเภทตัวชี้วัด">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="kpi_unit" 
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" 
                        HeaderStyle-Width="100px" HeaderText="หน่วยวัด">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                        DataField="bgm_kpi_det_result_TOTAL" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px" 
                        HeaderText="รวมทั้งสิ้น" ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter1" 
                        DataField="Q1_Target" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="แผน" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter1" 
                        DataField="Q1_Result" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="ผล" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter2" 
                        DataField="Q2_Target" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="แผน" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter2" 
                        DataField="Q2_Result" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="ผล" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter3" 
                        DataField="Q3_Target" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="แผน" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter3" 
                        DataField="Q3_Result" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="ผล" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter4" 
                        DataField="Q4_Target" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="แผน" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" ColumnGroupName="quarter4" 
                        DataField="Q4_Result" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="80px" HeaderText="ผล" 
                        ItemStyle-HorizontalAlign="Right">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>

        <telerik:RadGrid ID="grdRadAnnual" runat="server" CellSpacing="0" 
            AutoGenerateColumns="false" Visible="false" GridLines="None" Width="985px" Height="500px">
            <MasterTableView Width="100%" DataKeyNames="kpi_seq" ShowHeadersWhenNoRecords="true">
                <NoRecordsTemplate>
                    <div> There are no records to display </div>
                </NoRecordsTemplate>
                <ColumnGroups>
                    <telerik:GridColumnGroup HeaderText="ปี"
                        Name="annual" HeaderStyle-Font-Bold="true" 
                        HeaderStyle-HorizontalAlign="Center" >
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridColumnGroup>
                </ColumnGroups>
                <Columns>
                    <telerik:GridTemplateColumn AllowFiltering="false" visible="true" >
                        <HeaderStyle HorizontalAlign="Center" Width="30px" />
                        <ItemTemplate>
                            <asp:ImageButton ID="Edit" runat="server" BorderWidth="0px" 
                                ImageUrl="../Image/Grid/Edit.gif" 
                                OnClientClick='<%# String.Format("ItemClicked({0},{1})",Eval("kpi_seq"),Eval("target_seq")) %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="kpi_name"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="250px"
                        HeaderText='ชื่อตัวชี้วัด' UniqueName="kpi_name">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="bgm_kpi_type_name"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ประเภทตัวชี้วัด">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="kpi_unit"
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="หน่วยวัด">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Year_Target"
                        ColumnGroupName="annual" 
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" 
                        ItemStyle-HorizontalAlign="Right" HeaderText="แผน">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Year_Result"
                        ColumnGroupName="annual" 
                        HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" 
                        ItemStyle-HorizontalAlign="Right" HeaderText="ผล">
                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>


    </asp:Panel>

    </div>
</asp:Content>
